package com.example.apidocserver.application.event.impl;

import com.example.apidocserver.application.event.FieldEvent;
import com.example.apidocserver.domain.document.entity.ApiParamField;
import com.example.apidocserver.domain.document.event.FieldParamDomainEvent;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 字段相关处理事件
 *
 * @author xyqlg
 */
@Service
public class FieldEventImpl implements FieldEvent {
    @Resource
    private FieldParamDomainEvent fieldParamDomainEvent;

    @Override
    public List<ApiParamField> findLikeFields(String world, Integer apiId, Integer spaceId) {
        return fieldParamDomainEvent.findLikeFields(world, apiId, spaceId);
    }

    @Override
    public ApiParamField findByUinKey(ApiParamField field) {
        return fieldParamDomainEvent.findByUniKey(field);
    }

    @Override
    public List<ApiParamField> findBySpaceId(Integer spaceId) {
        return fieldParamDomainEvent.findBySpaceId(spaceId);
    }

    @Override
    public boolean deleteById(Integer fieldId) {
        return fieldParamDomainEvent.deleteById(fieldId);
    }

    @Override
    public void upsertOne(ApiParamField field) {
        fieldParamDomainEvent.upsertOne(field);
    }
}
